//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<XSimple.h>
///	@path	~/src/scene/xsimple/
///	@date	2007/12/23
///	@desc	A simple IScene implementation.

#pragma once

#include "xeres.h"

#include <map>

#include "scene/IScene.h"
#include "scene/ILive.h"
#include "scene/IEntity.h"

namespace xeres {

	/*!
		\class	XSimple
		\brief	A simple IScene implementation.
				An XSimple contains a set of ILives, and manages some entities inside.

	*/
	class XSimple : public IScene
	{
	public:

		/// \ctor
		XSimple( void );

		/// \dtor
		virtual ~XSimple( void );

		DECL_IOBJECT_CLASS_DYNAMIC( XSimple , IScene );

	public:

		/// \impl
		virtual bool Initialize( const WString& name , ResourceLoader * loader , RefWeak<IData> res );

		/// \impl
		virtual void Finalize( void );

		/// \impl
		virtual void Preload( const Vector<float>& center );

		/// \impl
		virtual void Enter( RefWeak<ICamera> camera );

		/// \impl
		virtual void Leave( void );

		/// \impl
		virtual void Tick( const Frame& frame );

		/// \impl
		virtual void Present( ScenePresentation& sp );

		/// \impl
		virtual void Synchronized( void );

		/// \impl
		virtual const Box<float>& GetBound( void );

	private:

		// scene name
		WString								m_name;

		// camera
		Ref<ICamera>						m_camera;

		// scene title
		WString								m_title;
		
		// world bound
		Box<float>							m_bound;

		// lives in scene
		std::deque< Ref<ILive> >			m_lives;

		// entities inside the scene
		std::map< uint32 , Ref<IEntity> >	m_entities;
	};

} // namespace xeres
